#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QLabel>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setAttribute(Qt::WA_AcceptTouchEvents);
    connect(ui->stackedWidget, SIGNAL(fingerGesture(SlidingStackedWidget::SlideDirection)),
            this, SLOT(onFingerGesture(SlidingStackedWidget::SlideDirection)));
}

void MainWindow::onFingerGesture(SlidingStackedWidget::SlideDirection direction)
{
    if (direction == SlidingStackedWidget::LeftToRight)
        ui->stackedWidget->slideInIdx(1);
    else if (direction == SlidingStackedWidget::RightToLeft)
        ui->stackedWidget->slideInIdx(0);
}

MainWindow::~MainWindow()
{
    delete ui;
}

